<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSendOrderPatternTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('send_order_pattern', function (Blueprint $table) {
            $table->integerIncrements('id');

            $table->bigInteger('service_id', false, true)->default(0)->comment('业务类别ID');
            $table->integer('distance', false, true)->default(0)->comment('距离');
            $table->tinyInteger('level', false, true)->default(0)->comment('等级 1 2 3 越小越优先');

            $table->foreign('service_id')->references('id')->on('service');

            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('send_order_pattern');
    }
}
